package com.pi2e.view.viewlistener.impl;

import com.pi2e.common.Pi2eLogger;
import com.pi2e.view.viewlistener.IViewCallBackOnClickListener;
import com.pi2e.view.viewlistener.ListenerModel;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.View;


public  class  SettingActivityClickListener<T> implements IViewCallBackOnClickListener<T>{
	
	private Context context ;
	private Intent mIntent ;
	public SettingActivityClickListener(Context context ) {
		this.context = context ;
	}

	
	@Override
	public Object onClickListener(T t, View v,ListenerModel model) {
		if (model == ListenerModel.INTENT) {
			if (null != mIntent) {
				((Activity)context).startActivity(mIntent);
			}else{
				Pi2eLogger.e("非法调用，请先调用setmIntent()方法设置Intent");
			}
			
		}
		return null;
	}

	public Context getContext() {
		return context;
	}

	public void setContext(Context context) {
		this.context = context;
	}


	public Intent getmIntent() {
		return mIntent;
	}


	public void setmIntent(Intent mIntent) {
		this.mIntent = mIntent;
	}
	
}
